/**
 * Copyright (C) 2011 Vinicius Vielmo Cogo, Marcelo Pasin, and the authors
 * indicated in the @author tags.
 * 
 * This file is part of DiversityAgent.
 * 
 * DiversityAgent is a free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 * 
 * DiversityAgent is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with DiversityAgent. If not, see <http://www.gnu.org/licenses/>.
 */
package diversity_agent;

/**
 * 
 * @author Vinicius Vielmo Cogo (vielmo at lasige.di.fc.ul.pt)
 * @version 0.1-beta
 * @since 2011-11-18
 * 
 */
public class CloudFactory
{

	/**
	 * 
	 * @param theCloudName
	 * @param theTool
	 * @param theType
	 * @param theAddress
	 * @param theUsername
	 * @param thePassword
	 * @return
	 */
	public Cloud getCloud(String theCloudName, String theTool, String theType,
			String theAddress, String theUsername, String thePassword)
	{
		Cloud aCloud = null;
		if (theTool.equals("OPEN_NEBULA")) {
			try {
				aCloud = new drivers.OpenNebula(theCloudName, theTool, theType,
						theAddress, theUsername, thePassword);
			} catch (NullPointerException e) {
				System.out.println("Problem on registering a new cloud.");
				return null;
			}
		}
		// } else if (theCloudName.equals("OPEN_STACK")) {
		// System.out.println("[WARNING   ] The driver for " + theTool
		// + " is not implemented yet.");
		// // return new OpenStack();
		// } else if (theCloudName.equals("EUCALYPTUS")) {
		// System.out.println("[WARNING   ] The driver for " + theTool
		// + " is not implemented yet.");
		// System.out.println("Deu erro no cloud factory");
		// // return new Eucalyptus();
		// } else if (theCloudName.equals("AMAZON_EC2")) {
		// System.out.println("[WARNING   ] The driver for " + theTool
		// + " is not implemented yet.");
		// // return new AmazonEC2();
		// }
		return aCloud;
	}
}